[AIE2] Support for allowing direct VEXTRACT to 20-bit registers#233
[AIE2] Support for allowing direct VEXTRACT to 20-bit registers#233abhinay-anubola merged 3 commits intoaie-publicfrom
Conversation
llvm/test/CodeGen/AIE/aie2/GlobalISel/prelegalizercombiner-s20-narrowing.mir
Outdated
Show resolved
Hide resolved
llvm/test/CodeGen/AIE/aie2/GlobalISel/prelegalizercombiner-s20-narrowing.mir
Outdated
Show resolved
Hide resolved
|
Given that you mentioned there are no QoR gain, I would recommend you to re look at the instruction that consume S20 type reg. |
650d8a9 to
d5d7cf0
Compare
d5d7cf0 to
f12f1a4
Compare
35027af to
000b09e
Compare
000b09e to
e7731e6
Compare
There was a problem hiding this comment.
Nice! Did you check all targets?
There was a problem hiding this comment.
Yes, I have checked all targets.
There was a problem hiding this comment.
Do we need to change the return types? I would expect that we only need to add a %10:_(s32) = G_ASSERT_[S/Z]EXT %9, 16 and keep the rest intact thanks to the new sext(trunc x) combiner you added previously.
There was a problem hiding this comment.
Yes, we need to change the return types, because the pattern that is written in new sext(trunc x) combiner will not match in this case as m_SpecificType is trying to match s20 but return type here is s32.
mi_match(SrcReg, MRI, m_GTrunc(m_all_of(m_Reg(Reg), m_SpecificType(DstTy))))
e7731e6 to
467672d
Compare
2d5aaad to
de8468e
Compare
de8468e to
c3cba3e
Compare
There was a problem hiding this comment.
Nit: I guess we could still eliminate the G_TRUNC, and change G_SEXT to extend from 32 -> 64?
There was a problem hiding this comment.
This story requires a (sext (trunc x)) → x combiner; we can create a new ticket for the G_TRUNC elimination
c3cba3e to
fcf4285
Compare
fcf4285 to
14eea26
Compare
|
|
||
| bool CombinerHelper::matchCombineSextTrunc(MachineInstr &MI, Register &Reg) { | ||
| assert(MI.getOpcode() == TargetOpcode::G_SEXT && "Expected a G_SEXT"); | ||
| const Register DstReg = MI.getOperand(0).getReg(); |
There was a problem hiding this comment.
nit: you could use const auto [DstReg, DstTy, SrcReg, SrcTy] = MI.getFirst2RegLLTs()
MachineVerifierhas been updated to allowG_AIE_SEXT_EXTRACT_VECTOR_ELTandG_AIE_ZEXT_EXTRACT_VECTOR_ELTto accept 20-bit outputs.